// PHSApp.h: interface for the CPHSApp class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PHSAPP_H__2AEEAB99_3C46_4DBC_8422_B3FBBE5026FB__INCLUDED_)
#define AFX_PHSAPP_H__2AEEAB99_3C46_4DBC_8422_B3FBBE5026FB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/*
#include "..\Standardofboltnut.h"
#include "..\Standardofclamp.h"
#include "..\standardofconnect.h"
#include "..\standardofconstspring.h"
#include "..\standardofsa.h"
#include "..\standardofspring.h"
#include "..\standardofAttach.h"
*/
#include "Singleton.h"

class DllExport UETolerance
{
public:
	UETolerance(){
		m_dbEqualVector = 0.1;
		m_dbEqualPoint = 0.1;
	}
	virtual ~UETolerance(){
	}

public:
	DOUBLE EqualPoint() const {
		return m_dbEqualPoint;
	}

	void EqualPoint(DOUBLE dbEqual){
		m_dbEqualPoint = dbEqual;
	}

	DOUBLE EqualVector() const {
		return m_dbEqualVector;
	}

	void EqualVector(DOUBLE dbEqual){
		m_dbEqualVector = dbEqual;
	}

	const UETolerance& operator=(const UETolerance& tol){
		if(this == &tol)
			return *this;

		m_dbEqualVector = tol.m_dbEqualVector;
		m_dbEqualPoint = tol.m_dbEqualPoint;

		return *this;
	}
private:
	DOUBLE m_dbEqualPoint;
	DOUBLE m_dbEqualVector;
};

class DllExport CPHSApp  
{
	DECLARE_SINGLETON(CPHSApp);
public:
	void CloseConnection();
	BOOL InitApplication();
	void SaveApplication();


	const CString& SHDefaultBlock() const {
		return m_strDefaultSHBlock;
	}

	void SHDefaultBlock(const CString& strBlock){
		m_strDefaultSHBlock = strBlock;
	}

	const CString& DefaultPrjName() const {
		return m_strDefaultPrjName;
	}

	void DefaultPrjName(const CString& strPrj){
		m_strDefaultPrjName = strPrj;
	}

	const CString& DefaultPrjVersion() const {
		return m_strDefaultPrjVersion;
	}

	void DefaultPrjVersion(const CString& strVersion){
		m_strDefaultPrjVersion = strVersion;
	}
	
	CPHSApp();
	virtual ~CPHSApp();

	const CString& MenuName() const {
		return m_strMenuName;
	}

	void MenuName(const CString& strName){
		m_strMenuName = strName;
	}
	
	const CString& JointFormerName() const {
		return m_strJointFormerName;
	}

	void JointFormerName(const CString& strName){
		m_strJointFormerName = strName;
	}

	const UETolerance& PHSTolerance() const {
		return m_Tol;
	}

	const CString& DefaultDrawSpecName() const {
		return m_strDefaultDrawSpecName;
	}

	void DefaultDrawSpecName(const CString& strName){
		m_strDefaultDrawSpecName = strName;
	}

	const CString& CurDrawSpecName() const {
		return m_strCurSpecName;
	}

	void CurDrawSpecName(const CString& strName) {
		m_strCurSpecName = strName;
	}

private:
	CString m_strDefaultSHBlock;
	CString m_strDefaultPrjName;
	CString m_strDefaultPrjVersion;
	CString m_strMenuName;
	CString m_strJointFormerName;
	CString m_strDefaultDrawSpecName;
	CString m_strCurSpecName;
	UETolerance m_Tol;
};

DllExport CPHSApp* GetPHSApp();
DllExport BOOL IsNumber(CString& str);
#endif // !defined(AFX_PHSAPP_H__2AEEAB99_3C46_4DBC_8422_B3FBBE5026FB__INCLUDED_)
